<?php

/**
 * Comment form.
 *
 * @package    IPLIFE
 * @subpackage form
 * @author     alexey.shapran@gmail.com
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class CommentForm extends BaseCommentForm
{
	public function configure()
	{
		$this->setWidgets(array(
  	'body' => new sfWidgetFormTextarea(array(),array('class'=>'questiontext')),
		//'captcha' => new sfWidgetFormReCaptcha(array('public_key' => '6Lc2cLsSAAAAAO31GGR8RSboWmXFwX5f8_GWNvVw')),
    'entity_id'   => new sfWidgetFormInputHidden(),
    'entity_type' => new sfWidgetFormInputHidden(),
  	'user_id'     => new sfWidgetFormInputHidden(),
  	'capcha_res'  => new sfWidgetFormInputHidden(),
  	'_csrf_token' => new sfWidgetFormInputHidden(),
		));
			
		$this->widgetSchema->setLabel('body','Текст комментария');
		//  	<script>
		//var RecaptchaOptions = {
		//   theme : "clean",
		//   custom_theme_widget: "recaptcha_widget"
		//};
		//</script>
		//  	');
		//  	$this->widgetSchema->setLabel('captcha','Защита от спама');

			
		//$this->validatorSchema['captcha'] = new sfValidatorReCaptcha(array('private_key' => '6Lc2cLsSAAAAAJrkmHvZqWaA7nRUUupS-IsadYcj' ));
		$this->validatorSchema['body'] = new sfValidatorString(array('required'=>'true', 'min_length'=>'1'), array('required'=>'Поле обязательно для ввода'));
		$div = '<div style="font-size:18px;">';
		$this->validatorSchema['capcha_res'] = new sfValidatorString(array('required' => true, 'min_length'=>'3'), array('invalid'=>$div.'Защита от спама обязательна для ввода'.'</div>','min_length'=>$div.'Защина от спама не пройдена'.'</div>'));
	}
}
